<?php

use Phinx\Migration\AbstractMigration;

class AddColumnAssigneeTimeStartTimeEndTimeExecutorConfirmedInTaskTable extends AbstractMigration
{
    public function up()
    {
        $this->table("task")
            ->addColumn('executor_confirmed', 'enum', ['values' => 'yes,no', 'default' => 'no', 'comment' => '执行人是否确认'])
            ->addColumn('assignee_at', 'integer', ['signed' => false, 'default' => 0, 'limit' => 10, 'comment' => '分配时间'])
            ->addColumn('start_time', 'integer', ['signed' => false, 'default' => 0, 'limit' => 10, 'comment' => '实际开始时间'])
            ->addColumn('end_time', 'integer', ['signed' => false, 'default' => 0, 'limit' => 10, 'comment' => '完成时间'])
            ->save();


    }

    public function down()
    {
        $this->table("task")
            ->removeColumn("executor_confirmed")
            ->removeColumn("assignee_at")
            ->removeColumn("start_time")
            ->removeColumn("end_time")->save();
    }
}
